package  com.loma.ctrl;
import  com.loma.entity.Project;
import  com.loma.service.ProjectService;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping(value = "/project", method = RequestMethod.POST)
public class ProjectCtrl {
@Autowired
private ProjectService service;

 @PostMapping("/save")
    public    Project  save(@RequestBody  Project json){
        return service.save(json);

    }

 @PostMapping("/id")
    public    Project  id(@RequestBody Project json){
        return service.findById(json);

    }

 @PostMapping("/delete")
    public   void  delete(@RequestBody  Project json){
          service.delete(json);

    }
 @PostMapping( "/list/{page}")
    public Page<Project> list(@RequestBody Project json,@PathVariable int page){
     return   service.list(json, page  );  
        
    }} 
